package com.itzol.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itzol.entity.Consume;
import com.itzol.entity.ConsumeVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ConsumeMapper extends BaseMapper<Consume> {
    @Select("select c.create_date,u.Name,c.money,u.Phone from consume c,users u where c.consumer=#{id} and c.consumer=u.id")
    List<ConsumeVo> GetConsumeVo(Integer id);
    @Select("select money from consume where date(create_date)=curdate()")
    List<ConsumeVo> Getday();
    @Select("SELECT * FROM consume where DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(create_date)")
    List<Consume> Getmonth();

}
